<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    正在测试jq的一些小工具类方法
    <form>
        <input type="text" name="username" value="">
        <input type="text" name="password" value="">
    </form>
    <span class="btn">按钮</span>
</body>
<script src="./libs/jquery.js"></script>
<script>
    const obj = {
        username:"admin",
        password:123123,
        abc:"hahaha"
    }

    // 将↑↑↑对象处理成↓↓↓

    "username=admin&password=12313&abc=haha"
    
    console.log(fn(obj));

    console.log($.param(obj));
    
    // -===========
    
    $("span").click(function(){
        console.log($('form').serialize());
    })
    
    // -===========


    const obj1 = {
        a:10
    }
    const obj2 = {
        b:20
    }
    $.extend(obj1, obj2)
    console.log(obj1)
    console.log(obj2)


    $.extend({
        qf:function(){
            console.log("666")
        }
    })
    $.qf();
    

    // =============

    const foo = {
        name:"admin",
        age:18,
        sex:"男"
    }
    $.each(foo, (key,val)=>{
        console.log(key, val)
    })

    for(var i in foo){
        console.log(i, foo[i])
    }



    function fn(obj){
        let str="";
        for(let i in obj){
            str += `${i}=${obj[i]}&`
        }
        return str;
    }
</script>
</html>